Scenario #2012: Create External Debitor for Partner

UseCase Create External Debitor For Partner => Debitor: D-3101002 - Test AG - external debitor

Properties

Required

Given

name value
partnerPersonTradeName Test AG
billingContactCaption Billing GmbH - billing department
billingContactEmailAddress billing@test-ag.example.org
debitorNumberSuffix 02
billable true
vatId VAT123456
vatCountryCode DE
vatBusiness true
vatReverseCharge false
defaultPrefix tsy

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "3029ef4b-ab91-429d-855b-26a8bedcef6e", // partnerPersonUuid
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

BankAccount: Billing GmbH - refund bank account

HTTP POST "/api/hs/office/bankaccounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "holder" : "Billing GmbH - refund bank account",
  "iban" : "DE02120300000000202051",
  "bic" : "BYLADEM1001"
}
EOF
=> status: 201 CREATED 7917e2fc-9cd9-4e02-baef-f80c76571a7c

Contact: Billing GmbH - Test AG billing

HTTP POST "/api/hs/office/contacts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "caption" : "Billing GmbH, billing for Test AG",
  "emailAddresses" : {
    "main" : "test-ag@billing-GmbH.example.com"
  }
}
EOF
=> status: 201 CREATED 4a803ee0-849b-478f-a833-b3de4e68282c

Create Debitor: D-3101002 - Test AG - external debitor

HTTP POST "/api/hs/office/debitors" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  <<EOF
{
  "debitorRel" : {
    "anchor.uuid" : "3029ef4b-ab91-429d-855b-26a8bedcef6e", // Person: Test AG
    "holder.uuid" : "90274208-b217-4d2d-8a71-fef16217dfaa", // Person: Billing GmbH
    "contact.uuid" : "4a803ee0-849b-478f-a833-b3de4e68282c" // Contact: Billing GmbH - Test AG billing
  },
  "debitorNumberSuffix" : "02",
  "billable" : true,
  "vatId" : "VAT123456",
  "vatCountryCode" : "DE",
  "vatBusiness" : true,
  "vatReverseCharge" : false,
  "refundBankAccount.uuid" : "7917e2fc-9cd9-4e02-baef-f80c76571a7c", // BankAccount: Billing GmbH - refund bank account
  "defaultPrefix" : "tsy"
}
EOF
=> status: 201 CREATED aa269904-1218-4914-9057-82cc4a531431

generated on 2026-08-10 03:08:30 for branch HEAD